<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>nih: nih::cuda::Kd_knn&lt; 3 &gt; Struct Template Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">nih
   &#160;<span id="projectnumber">0.5</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('structnih_1_1cuda_1_1_kd__knn_3_013_01_4.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">nih::cuda::Kd_knn&lt; 3 &gt; Struct Template Reference<div class="ingroups"><a class="el" href="group__knn.html">k-Nearest Neighbors</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="nih::cuda::Kd_knn&lt; 3 &gt;" -->
<p><code>#include &lt;<a class="el" href="knn_8h_source.html">knn.h</a>&gt;</code></p>

<p><a href="structnih_1_1cuda_1_1_kd__knn_3_013_01_4-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structnih_1_1cuda_1_1_kd__knn_3_013_01_4_1_1_result.html">Result</a></td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename QueryIterator , typename PointIterator &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structnih_1_1cuda_1_1_kd__knn_3_013_01_4.html#a70c1237dd1598e801322c991705f8e35">run</a> (const QueryIterator points_begin, const QueryIterator points_end, const <a class="el" href="structnih_1_1_kd__node.html">Kd_node</a> *kd_nodes, const uint2 *kd_ranges, const uint2 *kd_leaves, const PointIterator kd_points, Result *results)</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><h3>template&lt;&gt;<br/>
struct nih::cuda::Kd_knn&lt; 3 &gt;</h3>

<p>GPU-based k-Nearest Neighbors lookup context.</p>
<p>This class provides the context to perform 3-dimensional k-nn lookups on the GPU, using a k-d tree.</p>
<p>The following code snippet shows how to use this class:</p>
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include &lt;nih/kd/cuda/kd_knn.h&gt;</span>

 thrust::device_vector&lt;Vector4f&gt; kd_points;
 thrust::device_vector&lt;Kd_node&gt;  kd_nodes;
 thrust::device_vector&lt;uint2&gt;    kd_leaves;
 thrust::device_vector&lt;uint32&gt;   kd_index;

 thrust::device_vector&lt;Vector4f&gt; query_points;
 ... <span class="comment">// code to build the k-d tree and query points here...</span>
     <span class="comment">// NOTE: even though we&#39;re doing 3-dimensional queries,</span>
     <span class="comment">// we can use Vector4f arrays for better coalescing</span>

 thrust::device_vector&lt;cuda::Kd_knn&lt;3&gt;::Result&gt; results( query_points.size() );

 <a class="code" href="structnih_1_1cuda_1_1_kd__knn_3_013_01_4.html">nih::cuda::Kd_knn&lt;3&gt;</a> knn;
 knn.<a class="code" href="structnih_1_1cuda_1_1_kd__knn_3_013_01_4.html#a70c1237dd1598e801322c991705f8e35">run</a>(
     query_points.begin(),
     query_points.end(),
     thrust::raw_pointer_cast( &amp;kd_nodes.front() ),
     thrust::raw_pointer_cast( &amp;kd_ranges.front() ),
     thrust::raw_pointer_cast( &amp;kd_leaves.front() ),
     thrust::raw_pointer_cast( &amp;kd_points.front() ),
     thrust::raw_pointer_cast( &amp;results.front() ) );
</pre></div> </div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a70c1237dd1598e801322c991705f8e35"></a><!-- doxytag: member="nih::cuda::Kd_knn&lt; 3 &gt;::run" ref="a70c1237dd1598e801322c991705f8e35" args="(const QueryIterator points_begin, const QueryIterator points_end, const Kd_node *kd_nodes, const uint2 *kd_ranges, const uint2 *kd_leaves, const PointIterator kd_points, Result *results)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename QueryIterator , typename PointIterator &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="structnih_1_1cuda_1_1_kd__knn.html">nih::cuda::Kd_knn</a>&lt; 3 &gt;::run </td>
          <td>(</td>
          <td class="paramtype">const QueryIterator&#160;</td>
          <td class="paramname"><em>points_begin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QueryIterator&#160;</td>
          <td class="paramname"><em>points_end</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structnih_1_1_kd__node.html">Kd_node</a> *&#160;</td>
          <td class="paramname"><em>kd_nodes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint2 *&#160;</td>
          <td class="paramname"><em>kd_ranges</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint2 *&#160;</td>
          <td class="paramname"><em>kd_leaves</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const PointIterator&#160;</td>
          <td class="paramname"><em>kd_points</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Result *&#160;</td>
          <td class="paramname"><em>results</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>perform a k-nn lookup for a set of query points</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">points_begin</td><td>beginning of the query point sequence </td></tr>
    <tr><td class="paramname">points_end</td><td>end of the query point sequence </td></tr>
    <tr><td class="paramname">kd_nodes</td><td>k-d tree nodes </td></tr>
    <tr><td class="paramname">kd_ranges</td><td>k-d tree node ranges </td></tr>
    <tr><td class="paramname">kd_leaves</td><td>k-d tree leaves </td></tr>
    <tr><td class="paramname">kd_points</td><td>k-d tree points</td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Template Parameters:</b></dt><dd>
  <table class="">
    <tr><td class="paramname">QueryIterator</td><td>an iterator type dereferencing to Vector&lt;float,N&gt;, with N &gt;= 3 </td></tr>
    <tr><td class="paramname">PointIterator</td><td>an iterator type dereferencing to Vector&lt;float,N&gt;, with N &gt;= 3 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this struct was generated from the following files:<ul>
<li>kd/cuda/<a class="el" href="knn_8h_source.html">knn.h</a></li>
<li>kd/cuda/<a class="el" href="knn__inline_8h_source.html">knn_inline.h</a></li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><b>nih</b>      </li>
      <li class="navelem"><b>cuda</b>      </li>
      <li class="navelem"><a class="el" href="structnih_1_1cuda_1_1_kd__knn_3_013_01_4.html">Kd_knn&lt; 3 &gt;</a>      </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">Generated on Thu Dec 15 2011 11:56:22 for nih by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
